package com.ebelter.btcomlib.utils;



import android.os.Environment;


import java.io.File;


public class FileUtils {


    private static final String TAG = "FileUtils";

    //创建文件夹
    public static void makeDir(File dir) {
        if(!dir.getParentFile().exists()) {
            makeDir(dir.getParentFile());
        }
        dir.mkdir();
    }


    //获取SD卡的路径
    public static String getSDPath(){
        if (exitSD()) {
            File sdDir = Environment.getExternalStorageDirectory();//获取跟目录
            return sdDir.toString();
        }
        return null;

    }

    public static boolean exitSD(){
        return Environment.getExternalStorageState()
                .equals(android.os.Environment.MEDIA_MOUNTED); //判断sd卡是否存在
    }
}
